package com.example.plan.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
public enum ErrorCode {

    SUCCESS(0, "ok"),
    PARTIAL_CONTENT(206, "部分内容传输成功"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    UPDATE_USER_ADDRESS_ID_IS_NULL(50002, "修改用户地址，ID不能为空"),
    UPDATE_ORDER_ID_IS_NULL(50003, "修改订单，ID不能为空"),
    ORDER_DTO_INVALID(50004, "订单参数错误"),
    AR_NAVIGATION_NOT_FOUND(50005,"AR导航标记不存在！" ),
    UPDATE_AR_NAVIGATION_ID_IS_NULL(50006, "修改AR导航标记，ID不能为空"),
    DRONE_NOT_FOUND(50007,"无人机设备不存在！" ),
    UPDATE_DRONE_ID_IS_NULL(50008, "修改无人机设备，ID不能为空"),
    RISK_ALERT_NOT_FOUND(50009,"风险预警不存在！"),
    UPDATE_RISK_ALERT_ID_IS_NULL(50010,"修改风险预警，ID不能为空！"),

    ;

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
    /**
     * 排序方式枚举
     */
    @Getter
    @AllArgsConstructor
    enum sortOrderEnum{
        ASC(1,"升序"),
        DESC(2,"降序");
        private final int code;
        private final String message;
    }

}